import functools
import operator
#from functools import cmp_to_key
def compare(e1,e2):
    return e1-e2
a = [2,3,1]

# a = [('b',2),('a',3),('d',4),('c',5)]
print(sorted(a,key = functools.cmp_to_key(operator.gt)))
# print(sorted(a,key = functools.cmp_to_key(compare)))